//
//  feather.cpp
//  template4
//
//  Created by Xiaochen Lian on 5/16/12.
//  Copyright (c) 2012 University of California, Los Angeles. All rights reserved.
//

#include "feather.h"

void IFeather::set_material(const lighting_struct &material)
{
    m_material = material;
}

void IFeather::draw(const Angel::mat4 &tfm_parent)
{
    glUniform4fv(uAmbient, 1, g_env_lighting.ambient * m_material.ambient);
    glUniform4fv(uDiffuse, 1, g_env_lighting.diffuse.x * m_material.diffuse);
    glUniform4fv(uSpecular, 1, g_env_lighting.specular * m_material.specular);
    glUniform1f(uShininess, g_env_lighting.shininess * m_material.shininess);
    // draw objects
    //        glBindVertexArray( m_shape_data.vao );
    //        for (int i = 0; i < m_children.size(); ++i)
    //            m_children[i]->draw(light_pos, env_lighting, pMc, cMw, tfm_parent*m_tfm);
    //drawPlane(tfm_parent*m_tfm*m_scale_mat);
    
    for (int i = 0; i < m_children.size(); ++i)
        m_children[i]->draw(tfm_parent*m_tfm);

}

